//
//  bytestring.cpp
//  cobalt
//
//  Created by Nicolas Godbout on 2013-08-19.
//  Copyright (c) 2013 Nicolas Godbout. All rights reserved.
//

#include "bytestring.h"

#include <cstdlib>
#include <cstring>

char*
ByteString::toCstr () const {
    char* ret = (char *)std::malloc(length+1);
    std::memcpy(ret, base + offset, length);
    ret[length] = 0;
    
    return ret;
}
